import http from '@/utils/axios';

// 获取菜单列表
export const getMenuList = (params?: any) => {
    return http({
        method: 'get',
        url: '/menu/index',
        params,
    });
};

// 获取菜单信息
export const getMenuInfo = (id: number) => {
    return http({
        method: 'GET',
        url: `/menu/read/${id}`,
    });
};

// 新增菜单信息
export const saveMenuInfo = (data: any) => {
    return http({
        method: 'POST',
        url: `/menu/save`,
        data,
    });
};

// 更新菜单信息
export const updateMenuInfo = (id: number, data: any) => {
    return http({
        method: 'PUT',
        url: `/menu/update/${id}`,
        data,
    });
};

// 删除菜单
export const deleteMenu = (id: number) => {
    return http({
        method: 'DELETE',
        url: `/menu/delete/${id}`,
    });
};